class Solution:
    def findMin(self, nums: list) -> int:
        def find(nums, left, right):
            while left < right - 1:
                mid = (left + right) // 2
                if nums[left] == nums[mid] or nums[mid] == nums[right] or nums[left] == nums[right]:
                    return min(
                        find(nums, left, mid), find(nums, mid + 1, right))
                if nums[mid] > nums[left] and nums[mid] > nums[right]:
                    left = mid
                elif nums[mid] < nums[left] and nums[mid] < nums[right]:
                    right = mid
                elif nums[mid] > nums[left] and nums[mid] < nums[right]:
                    right = mid
                elif nums[mid] < nums[left] and nums[mid] > nums[right]:
                    left = mid

            return min(nums[left], nums[right])

        return find(nums, 0, len(nums) - 1)
